package com.kj.misc.domain;

import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import com.google.common.collect.Lists;
import com.ivan.toolkit.common.Configs;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement
@NoArgsConstructor
public class MiscConfig {
	
	public static Configs.Instance<MiscConfig> instance = 
			Configs.at(MiscConfig.class).buildWithFile();
	
    @XmlElement
	@Getter @Setter
	private MiscFetcherConfig fetcherConfig = new MiscFetcherConfig();
	
	@XmlElement
	@Getter @Setter
	private MiscFusionConfig fusionConfig = new MiscFusionConfig();
	
	@XmlElement
	@Getter @Setter
	private MiscFeshConfig feshConfig = new MiscFeshConfig();
	
	
	@XmlElement
	@Getter @Setter
	private MiscFpaConfig fpaConfig = new MiscFpaConfig();
	
	
	
	public static List<String> getKeys(MiscConfig config) {
		
		List<String> keys = Lists.newLinkedList();
		
		if(config == null) {
			config = instance.get();
		}
		
		if(config != null) {
			return config.getFetcherConfig().getKeys();
		}
		
		return keys;
	}
}
